fix: respect hide_if_single across layout and input handlers#1558
Open
shiena wants to merge 4 commits into
Open
fix: respect hide_if_single across layout and input handlers#1558shiena wants to merge 4 commits into
shiena wants to merge 4 commits into
Conversation
5d68cf4 to
7bda168
Compare
Contributor
Author
|
Merging only one of them leaves a different hide-if-single symptom in
|
85a7485 to
3ab44bb
Compare
The shell-exit branch of CloseTerminal called resize_top_or_bottom_line but never re-applied the taffy layout, so sugarloaf.set_position kept using the old scaled_margin. With hide_if_single, the surviving tab left a tab-bar-sized gap at the top, and Renderer::run's per-panel is_dirty / force_full_damage gate also dropped the queued redraw, so the closed tab's last frame stayed on screen until the next user input. Re-apply the layout via update_dimensions and mark the screen dirty. The PTY performer follows up with a RioEvent::Render, so the existing event-driven redraw paints the surviving tab once the dirty flag clears the panel gate — no need to force a synchronous render from inside the event handler.
resize_top_or_bottom_line compared the new padding against dimension.margin, but apply_taffy_layout zeroes dimension.margin on every run. Once that has happened the "previous" margin reads as zero; when num_tabs drops to 1 and hide_if_single makes padding_y_top zero too, the comparison short-circuits and update_scaled_margin is never called. Compare against the grid's scaled_margin (divided by scale) instead, since that holds the authoritative current margin. Without this, closing the second tab with hide-if-single enabled left the tab-bar strip reserved at the top and terminal content drew below it instead of filling the freed area.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1518 (extending #1516), rebased onto
mainto resolve conflicts. Adds further fixes uncovered while testing the originalchange:
hide_if_single(110b1c3) —resize_top_or_bottom_linecomparedthe new padding against
dimension.margin, whichapply_taffy_layoutzeroes on every run, so thehide_if_singletransition was missed and
update_scaled_marginnever fired. Now compares against the grid's authoritativescaled_margin, andupdate_scaled_marginalso resyncs Taffy's root size so panels reflow into the freed area. Withoutthis, closing the second tab left the tab-bar strip reserved at the top; spawning a new tab pushed the bottom row past the
window.